import { Form, Input, Switch } from "antd";
import React from "react";

export default function FormDemo({ validateMessages, layout, scope, classifyList, tagList, handlerDataInfo, ...props }) {
  return (
    <Form {...layout} name="nest-messages" validateMessages={validateMessages}>
      <Form.Item label="文本摘要">
        <Input.TextArea
          placeholder="请输入文章摘要"
          autoSize={{ minRows: 5, maxRows: 8 }}
          value={scope.abstract}
          onChange={(e) => handlerDataInfo(e.target.value, "abstract")}
        />
      </Form.Item>
      <Form.Item label="访问密码">
        <Input.Password value={scope.visit_pwd} placeholder="输入后查看需要密码" onChange={(e) => handlerDataInfo(e.target.value, "visit_pwd")} />
      </Form.Item>
      <Form.Item label="付费查看">
        <Input.Password value={scope.pay_check} placeholder="输入后需要支付的费用" onChange={(e) => handlerDataInfo(e.target.value, "pay_check")} />
      </Form.Item>
      <Form.Item label="开启评论">
        <Switch checked={Boolean(Number(scope.is_comment))} onChange={(e) => handlerDataInfo(e, "is_comment")} />
      </Form.Item>
      <Form.Item label="首页推荐">
        <Switch checked={Boolean(Number(scope.focus))} onChange={(e) => handlerDataInfo(e, "focus")} />
      </Form.Item>
      {props.children}
    </Form>
  );
}
